<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>大厅</title>
<link rel="stylesheet" type="text/css" href="/dqchat/Public/css/style.css"/>

<script type="text/javascript" src="/dqchat/Public/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="/dqchat/Public/js/index_slider.js"></script>


<script type="text/javascript">


	$(function(){
		
		$('.main_bang').each(function(){
			$(this).children('.bang_item').eq(0).css("margin-top","5px");
		
		})
		$('.menu li').hover(function(){
			$('.menu li').removeClass('hover');
			$(this).addClass('hover');
		
		},function(){
		$(this).removeClass('hover');
		
		})
		$('.show_block').hover(function(){
			$(this).css('border-color','#bbb')
			$(this).find('.del').show();
		},function(){
			$(this).css('border-color','#ddd')
			$(this).find('.del').hide();
		})
		
		$('.del').click(function(){
			var total = parseInt($('#total').text());
			var string = $(this).attr('id');
			var obj = $(this);
			var id = string.split("_");
			var nid = id[2];  //删除ID
			var type = id[0]; //favorite or viewed
			
			$.ajax({
             type: "POST",
             url: "<?php echo U('oper');?>",
			 data: {
				  func: "del",
				  type: type,
				  nid: nid
					},
			 dataType: "json",
             success: function(data){
				 obj.parents('.show_block').remove();
				 $("#total").text(total-1);	
									}
			});
											
		})
	id = "<?php echo I('get.id');?>";
	
	$("#room_"+id).css("background","pink").parent('.menu').show();
	$("#room_"+id).parent('.menu').prev().css('background-image','url("/dqchat/Public/img/zhan.jpg")');

	   $('div.top_menu').click(function(){
	   if($(this).next('.menu').css("display")=='none'){
				$(this).next('.menu').css("display",'block');
				$(this).css('background-image','url("/dqchat/Public/img/zhan.jpg")');
			}else{
				$(this).next('.menu').css("display",'none');
				$(this).css('background-image','url("/dqchat/Public/img/shou.jpg")');	

			}			
		})		
		$(".bang_title li").hover(function(){				
			index = $(".bang_title li").index(this)+1;
			$(".bang_title li").each(function(){
				i = $(this).index()+1;
				$(this).css("background-image","url(/dqchat/Public/img/bang0"+i+".jpg)")
			})			
			$(this).css("background-image","url(/dqchat/Public/img/hbang0"+index+".jpg)");	
			$('.main_bang').removeClass('show');
			$('.main_bang').eq(index-1).addClass('show');
		})
	})
	
</script>
</head>

<body style="min-width:1187px;text-align:center;">
<div class="body" style="margin:0 auto;width:1187px;height:auto;">
<div class="wrapper" style="width:1187px;float:left;height:auto;text-align:left;position:relative;">
<div id="bk">

	<p style="margin-bottom:0px;"><img src="/dqchat/Public/img/<?php echo C('filename');?>/nlogo.jpg" /></p>
	<div style="width:208px;height:29px;text-align:center;background:url('/dqchat/Public/img/zaixian.png') no-repeat"><p style="color:#fff;font-size:14px;font-weight:bold;margin-bottom:0px;line-height:29px;font-family:'微软雅黑'">在线人数: <?php echo ($online); ?></p></div>

	<div class="top_menu" style="height:32px;background-color:#FF0033;border:1px solid #fff;border-top:none;color:#fff;background-image:url('/dqchat/Public/img/shou.jpg');background-repeat:no-repeat; background-position:190px 12px;font-size:13px;font-family:'微软雅黑'"><div class="gk1"><img style="position:relative;top:6px;margin-right:5px" src="/dqchat/Public/img/ren.jpg">收藏及最近去过的房间</div></div>

	<ul class="menu">
		<li id="room_favorite" style='font-size:12px;' onclick="javascript:window.location.href='<?php echo U('index?id=favorite');?>'">收藏房间</li>
		<li id="room_viewed" style='font-size:12px;' onclick="javascript:window.location.href='<?php echo U('index?id=viewed');?>'">最近去过的房间</li>
	</ul>
		<?php if(is_array($menu)): $key = 0; $__LIST__ = $menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($key % 2 );++$key;?><div class="top_menu" style="height:32px;background-color:#FF0033;border:1px solid #fff;color:#fff;;background-image:url('/dqchat/Public/img/shou.jpg');background-repeat:no-repeat; background-position:190px 12px;font-size:13px;font-family:'微软雅黑'"><div class="gk1"><img style="position:relative;top:6px;margin-right:5px;" src="/dqchat/Public/img/guanke.jpg"><?php echo ($vo["Top"]); ?></div></div>
			<ul class="menu">
			<?php if(is_array($vo["Child"])): $i = 0; $__LIST__ = $vo["Child"];if( count($__LIST__)==0 ) : echo "暂时无分区" ;else: foreach($__LIST__ as $key=>$sub): $mod = ($i % 2 );++$i;?><li style='font-size:12px;' id="room_<?php echo ($sub[1]); ?>" onclick="javascript:window.location.href='/dqchat/index.php/Home/HomePage/index?id=<?php echo ($sub[1]); ?>'"><?php echo ($sub[0]); ?>(<?php echo ($sub[2]); ?>)</li><?php endforeach; endif; else: echo "" ;endif; ?>
			</ul><?php endforeach; endif; else: echo "暂时无分区" ;endif; ?>	
	<div class="yule_menu" style="height:32px;background-color:#FF0033;border:1px solid #fff;color:#fff;font-size:13px;font-family:'微软雅黑'"><div class="gk1"><img style="position:relative;top:6px;margin-right:5px" src="/dqchat/Public/img/yule.jpg">娱乐中心</div></div>
	<ul class="yulemenu"  style="display:block;background-color:#fff;">
		<?php if(is_array($games)): $i = 0; $__LIST__ = $games;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li style="padding-left:30px;font-size:12px;"  onclick="javascript:window.location.href='game://<?php echo ($vo["ngameid"]); ?>'"><a  style="font-size:13px;font-family:'微软雅黑'"><?php echo ($vo["cname"]); ?>(<?php echo ($vo["nonline"]); ?>)</a></li><?php endforeach; endif; else: echo "" ;endif; ?>
	</ul>
</div>
<div class="index_main">

    <div id="focus">
        <ul>
		
		<?php if(is_array($image)): $i = 0; $__LIST__ = $image;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li><a <?php if($vo["clink"] != ''): ?>href="<?php echo ($vo["clink"]); ?>" <?php elseif($vo["nroomid"] != ''): ?> href="room://<?php echo ($vo["nroomid"]); ?>"<?php endif; ?> ><img src="<?php echo ($vo["cimage"]); ?>"  width="686" height="140" /></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
   
        </ul>
		
    </div>    
    <div class="main_search">
     <form name="seach_room" id='seach_room' method="get" action="<?php echo U('index');?>">
    	<div class="search_input">
        	<input type="text" name="room" style="font-family:'微软雅黑';top:7px;" class='room' value="房间号/房间名(至少2字)" onfocus="if(this.value!=''&&this.value=='房间号/房间名(至少2字)'){this.value=''}" onblur="if(this.value==''){this.value='房间号/房间名(至少2字)'}"/>
            <input type="button" name='gosearch' class='gosearch'/>
        </div>
     <form>
	  <script>
	  $(function(){
			$('.gosearch').click(function(){
			if($('.room').val()!="房间号/房间名(至少2字)"){
				
				$('#seach_room').submit();
				}else{
				alert('请输入房间号或房间名');
				}
				
			
			})
	  })
	  </script>
    </div>
    <div style="clear:both"></div>
    <div class="main_show">
    <?php if(empty($rooms)): ?>找不到匹配房间 <a href='<?php echo U(index);?>'>返回所有房间列表</a>
    <?php else: ?>
    <?php if(is_array($rooms)): $i = 0; $__LIST__ = $rooms;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><div class="show_block" style="border:1px solid #ddd;margin-right:6px;">
			<div class="show_image"><a href="room://<?php echo ($vo["nvcbid"]); ?>"/>
			<img width="155" height="123" src='<?php if(empty($vo['image'])){ echo "/dqchat/Public/img/noitem.jpg"; }else{ echo $vo['image']; }?>'  onerror="javascript:this.src='/dqchat/Public/img/noitem.jpg'"></a></div>
			<div class="show_name">			
				<div class="show_title" style="font-family:'微软雅黑'">
				<div style="float:left;"><a href="room://<?php echo ($vo["nvcbid"]); ?>" title="<?php echo ($vo["cname"]); ?>" /><?php echo cut_str($vo['cname'],10);?></a></div>	
				<?php if(($_GET['id']== 'favorite') OR ($_GET['id']== 'viewed') ): ?><div style="float:right;display:none;cursor:pointer;" id='<?php echo ($_GET['id']); ?>_del_<?php echo ($vo["nid"]); ?>' class="del" title="删除记录"><img src="/dqchat/Public/img/del.jpg" /></div><?php endif; ?>
				</div>
				<div style="clear:both"></div>
				<div style="font-family:'微软雅黑';font-size:12px;float:left;">ID:<?php echo ($vo["nvcbid"]); ?></div>
				<div style="color:#f29974;font-family:'微软雅黑';font-size:12px;float:right"><?php echo ($vo["nusercount"]); ?>/<?php echo ($vo["nseats"]); ?></div>

			</div>
		</div><?php endforeach; endif; else: echo "" ;endif; endif; ?> 
		
     </div>

	 <div style='clear:both'></div>
	 <?php if(!empty($rooms)): ?><!---分页列表--!--->
	 <?php echo ($list); endif; ?>

  </div>
  
  <div class="index_bang">
	<div class="bang_ad">
		<div class="money">
		<p style="font-family:'微软雅黑'">刷花奖池: <?php echo ($shuahua_rewards); ?></p><p>游戏奖池: <?php echo ($game_rewards); ?></p>
		</div>
	
	</div>

	<ul class='bang_title'>
		<li class="caifu"></li>
		<li class="renqi"></li>
		<li class="fangwu" style='margin-right:0px;'></li>
	</ul>
	<div style="clear:both"></div>
	
	<div class="main_bang show">
	    
		
		
		<?php if(is_array($weath)): $k = 0; $__LIST__ = $weath;if( count($__LIST__)==0 ) : echo "暂时没有数据" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><ul class="bang_item" <?php if($k == count($weath)): ?>style="height:30px;"<?php endif; ?> >
				<li class='bang_No <?php if(($k == 1) OR ($k == 2) OR($k == 3)): ?>bang_No1<?php endif; ?>'><?php echo ($k); ?></li>
				<li class="bang_userid" title="<?php echo ($vo["nuserid"]); ?>"><?php echo ($vo["nuserid"]); ?></li>
				<li class="bang_name" title="<?php echo ($vo["calias"]); ?>"><?php echo cut_str($vo['calias'],8);?></li>				
				<li class="bang_money" title="<?php echo ($vo["nmoney"]); ?>"><font color="#ff0033">
				<?php  $data = floor($vo['nmoney']); $length = strlen($data); if($length>4&&$length<9){ $total = substr($vo['nmoney'],0,($length-4)); echo $total."万"; }else if($length>8){ $total = substr($vo['nmoney'],0,($length-8)); echo $total."亿"; }else{ echo $data; }; ?>				
				</font></li>			
		</ul><?php endforeach; endif; else: echo "暂时没有数据" ;endif; ?>
		
	</div>
	<div class="main_bang">
		<?php if(is_array($service)): $k = 0; $__LIST__ = $service;if( count($__LIST__)==0 ) : echo "暂时没有数据" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><ul class="bang_item" <?php if($k == count($service)): ?>style="height:30px;"<?php endif; ?>>
				<li class='bang_No <?php if(($k == 1) OR ($k == 2) OR($k == 3)): ?>bang_No1<?php endif; ?>'><?php echo ($k); ?></li>
				<li class="bang_userid" title="<?php echo ($vo["nuserid"]); ?>"><?php echo ($vo["nuserid"]); ?></li>
				<li class="bang_name" title="<?php echo ($vo["calias"]); ?>"><?php echo cut_str($vo['calias'],8);?></li>				
				<li class="bang_money" title="<?php echo ($vo["nmoney"]); ?>"><font color="#ff0033">
				<?php  $data = floor($vo['nmoney']); $length = strlen($data); if($length>4&&$length<9){ $total = substr($vo['nmoney'],0,($length-4)); echo $total."万"; }else if($length>8){ $total = substr($vo['nmoney'],0,($length-8)); echo $total."亿"; }else{ echo $data; }; ?>				
				</font></li>
		</ul><?php endforeach; endif; else: echo "暂时没有数据" ;endif; ?>	
	</div>  
	<div class="main_bang">
		<?php if(is_array($fangjian)): $k = 0; $__LIST__ = $fangjian;if( count($__LIST__)==0 ) : echo "暂时没有数据" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($k % 2 );++$k;?><ul class="bang_item" <?php if($k == count($fangjian)): ?>style="height:30px;"<?php endif; ?>>
				<li class='bang_No <?php if(($k == 1) OR ($k == 2) OR($k == 3)): ?>bang_No1<?php endif; ?>'><?php echo ($k); ?></li>
				<li class="bang_userid" title="<?php echo ($vo["nvcbid"]); ?>"><?php echo ($vo["nvcbid"]); ?></li>
				<li class="bang_name" title="<?php echo ($vo["cname"]); ?>"><?php echo cut_str($vo['cname'],8);?></li>	
				<li class="bang_money" title="<?php echo ($vo["fscore"]); ?>"><font color="#ff0033">
				<?php  $data = floor($vo['fscore']); $length = strlen($data); if($length>4&&$length<9){ $total = substr($vo['fscore'],0,($length-4)); echo $total."万"; }else if($length>8){ $total = substr($vo['fscore'],0,($length-8)); echo $total."亿"; }else{ echo $data; }; ?>				
				</font></li>					
		</ul><?php endforeach; endif; else: echo "暂时没有数据" ;endif; ?>	
	</div>	
	
  </div>
 
</div>
</div>

</body>
</html>